<?php
namespace app\common\model;
use think\Model;

class FinanceWithdraw  extends Base
{

   protected $update_field = ['id','status','editor','audit_time'];
   public  function getlist($where='',$order='',$limit='10'){

     return $list = $this->where($where)->order($order)->paginate($limit);
  
   }
   public function getInfoById($id){
     $where['id'] = $id;
     return $this->where($where)->find();
   }
   public function getSuccessInfo($ids){
       return $this->where("id","IN",$ids)->where('status',1)->count();
   }

   public function del($id){
   	if(!$id){  return true; }
   	if(is_array($id)){
   	  $id = implode(',',$id);
   	}
   	 $where['id'] = $id;
     if($this->where($where)->delete()){
       return true;
     }else{
       return false;
     }
   }
  public function updateStatus($post){
    $where['id'] = $post['id'];
    $data['status'] = $post['status'];
    $data['editor'] = $post['editor'];
    $data['audit_time'] = time();
    if($this->update($data,$where,$this->update_field)){
      return true;
    }else{
      return false;
    }
  }

}
